package mgr;

import java.util.*;
import to.ClienteTO;
import dao.Transaction;
import dao.TransactionException;
import dao.ClienteDAO;


public class ClienteManager {
    ClienteDAO clienteDAO;
    
    public List<ClienteTO> filtraCliente(ClienteTO to) throws Exception {
        Transaction t = new Transaction();
        clienteDAO = new ClienteDAO(t);
        List<ClienteTO> list;
        try {
            list = clienteDAO.buscarCliente(to);
        } catch (Exception e) {
            throw new TransactionException(e);
        }
        return list;
    }
    
    /*
    public List<ClienteTO> filtraCliente(ClienteTO to) throws Exception {
        Transaction t = new Transaction();
        clienteDAO = new ClienteDAO(t);
        return (List<ClienteTO>) clienteDAO.buscarCliente(to);
    }
    */
    
    /*
    public static void main(String[] args) {
        ClienteManager mgr = new ClienteManager();
        try {
            List listadoCliente = mgr.filtraCliente(new ClienteTO("00000001", "", "", "", "", "", "", "", "", "", 0, "", "", ""));
            for(int i=0; i<listadoCliente.size(); i++){
                Object object = listadoCliente.get(i);
                String cadena = object.toString();
                cadena = cadena.toUpperCase();
                System.out.println(cadena+" generó!!!!");
            }
        }catch (Exception e) {
            System.out.println(e);
        }
        
    }
    */
}
